package com.portal4kids.view;

import java.util.ArrayList;
import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.portal4kids.controller.HolidaysManager;
import com.portal4kids.model.Holidays;

public class HolidaysAction extends ActionSupport{
	private Holidays holiday;
	private HolidaysManager holidayController;
	private List<Holidays> holidayList = new ArrayList<Holidays>();
	
	public HolidaysAction(){
		holidayController = new HolidaysManager();
	}
	
	public String execute(){
		return SUCCESS;		
	}
	
	public String saveHoliday(){
		holiday = holidayController.saveHoliday(getHoliday());
		return SUCCESS;		
	}
	
	public String searchHolidays(){
		holidayList = holidayController.getHolidaysFromDB(getHoliday().getType());
		return SUCCESS;		
	}

	public Holidays getHoliday() {
		return holiday;
	}

	public void setHoliday(Holidays holiday) {
		this.holiday = holiday;
	}

	public List<Holidays> getHolidayList() {
		return holidayList;
	}

	public void setHolidayList(List<Holidays> holidayList) {
		this.holidayList = holidayList;
	}
	
	

}
